<template>
  <div
      class="diy_edit feedback_on_opinions_edits page_feedback_on_opinions"
      id="feedback_on_opinions_edit"
  >
    <el-form
        :model="form"
        ref="ruleFormRef" 
		:rules="rules"
        label-width="auto"
        class="edit_feedback_on_opinions_form"
        size="large"
    >
      <el-row class="row_e">
          <el-col v-if="$check_field('ger','feedback_title','/feedback_on_opinions/view') || $check_field('add','feedback_title','/feedback_on_opinions/view') || $check_field('set','feedback_title','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="反馈标题" prop="feedback_title">
                      <el-input id="feedback_title" v-model="form['feedback_title']" placeholder="请输入反馈标题"
                      v-if="(form['feedback_on_opinions_id'] && $check_field('set','feedback_title','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','feedback_title','/feedback_on_opinions/view'))" :disabled="disabledObj['feedback_title_isDisabled']"></el-input>
            <div v-else-if="$check_field('ger','feedback_title','/feedback_on_opinions/view')">{{form['feedback_title']}}</div>
                    </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','feedback_type','/feedback_on_opinions/view') || $check_field('add','feedback_type','/feedback_on_opinions/view') || $check_field('set','feedback_type','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="反馈类型" prop="feedback_type">
                <el-select id="feedback_type" v-model="form['feedback_type']"                       v-if="(form['feedback_on_opinions_id'] && $check_field('set','feedback_type','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','feedback_type','/feedback_on_opinions/view'))">
              <el-option v-for="o in list_feedback_type" :key="o['classification_name']" :label="o['classification_name']"
                         :value="o['classification_name']">
              </el-option>
            </el-select>
            <div v-else-if="$check_field('ger','feedback_type','/feedback_on_opinions/view')">{{form['feedback_type']}}</div>
              </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','feedback_to_users','/feedback_on_opinions/view') || $check_field('add','feedback_to_users','/feedback_on_opinions/view') || $check_field('set','feedback_to_users','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="反馈用户" prop="feedback_to_users">
                              <div v-if="user_group !== '管理员'">
              {{ get_user_session_feedback_to_users(form['feedback_to_users']) }}
              <el-select v-if="(form['feedback_on_opinions_id'] && $check_field('set','feedback_to_users','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','feedback_to_users','/feedback_on_opinions/view'))" id="feedback_to_users" v-model="form['feedback_to_users']" :disabled="disabledObj['feedback_to_users_isDisabled']">
                <el-option v-for="o in list_user_feedback_to_users" :key="o['username']" :label="o['nickname'] + '-' + o['username']"
                           :value="o['user_id']">
                </el-option>
              </el-select>
              <el-select v-else-if="$check_field('ger','feedback_to_users','/feedback_on_opinions/view')" id="feedback_to_users" v-model="form['feedback_to_users']" :disabled="true">
                <el-option v-for="o in list_user_feedback_to_users" :key="o['username']" :label="o['nickname'] + '-' + o['username']"
                           :value="o['user_id']">
                </el-option>
              </el-select>
            </div>
            <el-select v-else id="feedback_to_users" v-model="form['feedback_to_users']" :disabled="disabledObj['feedback_to_users_isDisabled']">
              <el-option v-for="o in list_user_feedback_to_users" :key="o['username']" :label="o['nickname'] + '-' + o['username']"
                         :value="o['user_id']">
              </el-option>
            </el-select>
                                  </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','refund_type','/feedback_on_opinions/view') || $check_field('add','refund_type','/feedback_on_opinions/view') || $check_field('set','refund_type','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="退款类型" prop="refund_type">
                <el-select id="refund_type" v-model="form['refund_type']"
                       v-if="(form['feedback_on_opinions_id'] && $check_field('set','refund_type','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','refund_type','/feedback_on_opinions/view'))">
              <el-option v-for="o in list_refund_type" :key="o" :label="o" :value="o">
              </el-option>
            </el-select>
            <div v-else-if="$check_field('ger','refund_type','/feedback_on_opinions/view')">{{form['refund_type']}}</div>
              </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','refund_product','/feedback_on_opinions/view') || $check_field('add','refund_product','/feedback_on_opinions/view') || $check_field('set','refund_product','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="退款商品" prop="refund_product">
                <el-select id="refund_product" v-model="refund_product_multiple_value" multiple @change="select_refund_product_multiple"
                       v-if="(form['feedback_on_opinions_id'] && $check_field('set','refund_product','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','refund_product','/feedback_on_opinions/view'))">
              <el-option v-for="o in list_refund_product" :key="o['product_name']" :label="o['product_name']"
                         :value="o['product_name']">
              </el-option>
            </el-select>
            <div v-else-if="$check_field('ger','refund_product','/feedback_on_opinions/view')">{{form['refund_product']}}</div>
              </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','upload_credentials','/feedback_on_opinions/view') || $check_field('add','upload_credentials','/feedback_on_opinions/view') || $check_field('set','upload_credentials','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="上传凭证" prop="upload_credentials">
                <el-upload :disabled="disabledObj['upload_credentials_isDisabled']" class="avatar-uploader" drag
                       accept="image/gif, image/jpeg, image/png, image/jpg" action="" :http-request="upload_upload_credentials"
                       :show-file-list="false" v-if="(form['feedback_on_opinions_id'] && $check_field('set','upload_credentials','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','upload_credentials','/feedback_on_opinions/view'))">
              <img id="upload_credentials" v-if="form['upload_credentials']" :src="$fullUrl($banseUrl,form['upload_credentials'])" class="avatar">
              <el-icon v-else><Plus /></el-icon>
            </el-upload>
            <el-image v-else-if="$check_field('ger','upload_credentials','/feedback_on_opinions/view')" style="width: 100px; height: 100px"
                      :src="$fullUrl(form['upload_credentials'])" :preview-src-list="[$fullUrl(form['upload_credentials'])]">
              <div slot="error" class="image-slot">
                <img src="../../assets/images/user.png" style="width: 90px; height: 90px" />
              </div>
            </el-image>
              </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','more_vouchers','/feedback_on_opinions/view') || $check_field('add','more_vouchers','/feedback_on_opinions/view') || $check_field('set','more_vouchers','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="更多凭证" prop="more_vouchers">
                      <el-input id="more_vouchers" v-model="form['more_vouchers']" placeholder="请输入更多凭证"
                      v-if="(form['feedback_on_opinions_id'] && $check_field('set','more_vouchers','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','more_vouchers','/feedback_on_opinions/view'))" :disabled="disabledObj['more_vouchers_isDisabled']"></el-input>
            <div v-else-if="$check_field('ger','more_vouchers','/feedback_on_opinions/view')">{{form['more_vouchers']}}</div>
                    </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','upload_files','/feedback_on_opinions/view') || $check_field('add','upload_files','/feedback_on_opinions/view') || $check_field('set','upload_files','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="上传文件" prop="upload_files">
                      <div v-if="disabledObj['upload_files_isDisabled']">
              <div v-if="$check_field('ger','upload_files','/feedback_on_opinions/view')">
                <el-button type="primary" @click="$download($fullUrl(form['upload_files']),form['upload_files'])">下载<i
                        class="el-icon-download el-icon--right"></i></el-button>
              </div>
            </div>
            <div v-else>
              <el-upload v-if="(form['feedback_on_opinions_id'] && $check_field('set','upload_files','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','upload_files','/feedback_on_opinions/view'))" class="upload-demo" drag
                         action="" style="max-width: 300px;width: 100%;" :http-request="upload_upload_files" accept="">
                <el-icon><Plus /></el-icon>
                <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
              </el-upload>
              <div v-else-if="$check_field('ger','upload_files','/feedback_on_opinions/view')">
                <el-button type="primary" @click="$download($fullUrl($banseUrl,form['upload_files']),form['upload_files'])">下载<i
                        class="el-icon-download el-icon--right"></i></el-button>
              </div>
            </div>
                    </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','upload_audio','/feedback_on_opinions/view') || $check_field('add','upload_audio','/feedback_on_opinions/view') || $check_field('set','upload_audio','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="上传音频" prop="upload_audio">
                      <el-upload v-if="(form['feedback_on_opinions_id'] && $check_field('set','upload_audio','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','upload_audio','/feedback_on_opinions/view'))" class="upload-demo" drag
                       action="" style="max-width: 300px;width: 100%;" :http-request="upload_upload_audio" accept="audio/ogg,audio/mp3,audio/wav">
              <i class="el-icon-upload"></i>
              <div class="el-upload__text">将音频拖到此处，或<em>点击上传</em></div>
            </el-upload>
            <div v-else-if="$check_field('ger','upload_audio','/feedback_on_opinions/view')">
              <el-button type="primary" @click="download(form['upload_audio'])">下载<i
                      class="el-icon-download el-icon--right"></i></el-button>
            </div>
                    </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','upload_video','/feedback_on_opinions/view') || $check_field('add','upload_video','/feedback_on_opinions/view') || $check_field('set','upload_video','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="上传视频" prop="upload_video">
                      <el-upload v-if="(form['feedback_on_opinions_id'] && $check_field('set','upload_video','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','upload_video','/feedback_on_opinions/view'))" class="upload-demo" drag
                       action="" style="max-width: 300px;width: 100%;" :http-request="upload_upload_video" accept="video/ogg,video/mp4,video/webm">
              <i class="el-icon-upload"></i>
              <div class="el-upload__text">将视频拖到此处，或<em>点击上传</em></div>
            </el-upload>
            <div v-else-if="$check_field('ger','upload_video','/feedback_on_opinions/view')">
              <el-button type="primary" @click="download(form['upload_video'])">下载<i
                      class="el-icon-download el-icon--right"></i></el-button>
            </div>
                    </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','feedback_content','/feedback_on_opinions/view') || $check_field('add','feedback_content','/feedback_on_opinions/view') || $check_field('set','feedback_content','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_item_warp">
    <el-form-item label="反馈内容" prop="feedback_content">
                <el-input type="textarea" id="feedback_content" v-model="form['feedback_content']" placeholder="请输入反馈内容"
                      v-if="(form['feedback_on_opinions_id'] && $check_field('set','feedback_content','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','feedback_content','/feedback_on_opinions/view'))" :disabled="disabledObj['feedback_content_isDisabled']"></el-input>
            <div v-else-if="$check_field('ger','feedback_content','/feedback_on_opinions/view')">{{form['feedback_content']}}</div>
              </el-form-item>
        </el-col>
            <el-col v-if="$check_field('ger','detailed_description','/feedback_on_opinions/view') || $check_field('add','detailed_description','/feedback_on_opinions/view') || $check_field('set','detailed_description','/feedback_on_opinions/view')" :xs="24" :sm="24" :lg="24" class="el_form_editor_warp">
			<el-form-item label="详细描述" prop="detailed_description">
            <form_editor
                    v-if="(form['feedback_on_opinions_id'] && $check_field('set','detailed_description','/feedback_on_opinions/view')) || (!form['feedback_on_opinions_id'] && $check_field('add','detailed_description','/feedback_on_opinions/view')) "
                    class="editor el_form_editor_warp"
                    :details='form.detailed_description'
                    :form="form"
                    @blur_comment="blur_detailed_description"
                    @update_comment="update_detailed_description"
                    :publish_flag="false"
            />
            <div v-else-if="$check_field('ger','detailed_description','/feedback_on_opinions/view')" v-html="form['detailed_description']"></div>
          </el-form-item>
        </el-col>
        </el-row>
      <div v-if="$check_action('/feedback_on_opinions/view','set') || $check_action('/feedback_on_opinions/view','add') || $check_option('/feedback_on_opinions/table','examine')" class="footer">
        <el-button type="primary" @click="onSubmit" size="large">提交</el-button>
        <el-button @click="cancel()" size="large">取消</el-button>
      </div>
      <div v-else class="footer">
        <el-button @click="cancel()" size="large">取消</el-button>
      </div>
    </el-form>
  </div>
</template>

<script setup>
  import {ElMessage} from "element-plus";
  import {ref, onMounted} from "vue";
  import { $post, $get } from "@/api/Api.js";
  import storageHelper from "@/libs/StorageHelper";
  import {useStore} from "vuex";
  import { useRouter, useRoute } from "vue-router";
  import {
          $check_field,
          $fullUrl,
          $banseUrl,
          $check_action,
          $getUrlParams,
          filterSensitiveWords,
          $get_stamp,
          $get_rand,
          $toTime,
          $push
  } from "@/utils/utils.js";

  let router = useRouter();
  let route = useRoute();
  let store = useStore();
  let token = storageHelper.getToken() || null;
  let UserInfo = storageHelper.getUserInfo();
  let user_id = storageHelper.getUserInfo().user_id;
  let user_group = storageHelper.getUserInfo().user_group;
  let feedback_on_opinions_id = $getUrlParams().feedback_on_opinions_id;
  let url_add = ref("/api/feedback_on_opinions/add");
  let url_set = ref("/api/feedback_on_opinions/set");
  let field = ref("feedback_on_opinions_id")
  let url_get_obj = ref("/api/feedback_on_opinions/get_obj");
  let url_upload = ref("/api/feedback_on_opinions/upload");
  let ruleFormRef = ref(null);
  
  let rules = ref({
												  });

  let disabledObj = ref({
      "feedback_title_isDisabled": false,
        "feedback_type_isDisabled": false,
        "feedback_to_users_isDisabled": false,
        "refund_type_isDisabled": false,
        "refund_product_isDisabled": false,
        "upload_credentials_isDisabled": false,
        "more_vouchers_isDisabled": false,
        "upload_files_isDisabled": false,
        "upload_audio_isDisabled": false,
        "upload_video_isDisabled": false,
        "feedback_content_isDisabled": false,
        "detailed_description_isDisabled": false,
    });
  let form = ref({
    "feedback_title":  '', // 反馈标题
      "feedback_type":  '', // 反馈类型
        "feedback_to_users": 0, // 反馈用户
      "refund_type":  '', // 退款类型
      "refund_product":  '', // 退款商品
      "upload_credentials":  '', // 上传凭证
      "more_vouchers":  '', // 更多凭证
      "upload_files":  '', // 上传文件
      "upload_audio":  '', // 上传音频
      "upload_video":  '', // 上传视频
      "feedback_content":  '', // 反馈内容
      "detailed_description":  '', // 详细描述
      "feedback_on_opinions_id": 0, // ID
  });
  
            // 反馈类型选项列表
  let list_feedback_type = ref([""]);
  
    
    // 用户列表
  let list_user_feedback_to_users = ref([]);
        // 用户组
  let group_user_feedback_to_users=ref({});
                  // 退款类型选项列表
  let list_refund_type = ref(['其他','退款退货','仅退款','部分退款']);
  
            let refund_product_multiple_value = ref([]);
        // 退款商品选项列表
  let list_refund_product = ref([""]);
  
    
    
    
    
    
    
    
                                      //获取标签列表
    let get_list_feedback_type = async () => {
      let json = await $get("/api/classification_information/get_list");
      if (json.result && json.result.list) {
        list_feedback_type.value = json.result.list;
      } else if (json.error) {
        console.error(json.error);
      }
    }
                                                //获取注册用户用户列表
    let get_list_user_feedback_to_users = async () => {
      let json = await $get("/api/user/get_list?user_group=注册用户");
      if (json.result) {
        list_user_feedback_to_users.value = json.result.list;
      } else if (json.error) {
        console.error(json.error);
      }
    }
            //获取商城卖家用户组
    let get_group_user_feedback_to_users = async () => {
      let json = await $get("/api/user_group/get_obj?name=注册用户");
      if (json.result) {
        group_user_feedback_to_users.value = json.result.obj;
      } else if (json.error) {
        console.error(json.error);
      }
    }
    //获取
    let get_user_session_feedback_to_users = (id) => {
      let user_id = { user_id: id };
      let source_table = group_user_feedback_to_users.value.source_table
      if (source_table) {
        let url = "/api/" + source_table + "/get_obj"
        $get(url, {user_id: user_id}).then((res) => {
          if (res.result && res.result.obj) {
            var arr = []
            for (let key in res.result.obj) {
              arr.push(key)
            }
            var arrForm = []
            for (let key in form.value) {
              arrForm.push(key)
            }
            form.value["feedback_to_users"] = id
            disabledObj.value['feedback_to_users' + '_isDisabled'] = true
            for (var i = 0; i < arr.length; i++) {
              if (arr[i] !== 'examine_state' && arr[i] !== 'examine_reply') {
                for (var j = 0; j < arrForm.length; j++) {
                  if (arr[i] === arrForm[j]) {
                    if (arr[i] !== "feedback_to_users") {
                      form.value[arrForm[j]] = res.result.obj[arr[i]]
                      disabledObj.value[arrForm[j] + '_isDisabled'] = true
                      break;
                    } else {
                      disabledObj.value[arrForm[j] + '_isDisabled'] = true
                    }
                  }
                }
              }
            }
          }
        });
      }
    }
                                                    //获取标签列表
    let get_list_refund_product = async () => {
      let json = await $get("/api/customized_products/get_list");
      if (json.result && json.result.list) {
        list_refund_product.value = json.result.list;
      } else if (json.error) {
        console.error(json.error);
      }
    }
                    let select_refund_product_multiple = (v) => {
      form.value.refund_product = "";
      if (v && v.length > 0) {
        form.value.refund_product = v.toString();
      }
    };
                                /**
     * 上传上传凭证
     * @param {Object} param 文件参数
     */
    let upload_upload_credentials=(param) =>{
        uploadFile(param.file, "upload_credentials");
    }
                                                        /**
     * 上传上传文件
     * @param {Object} param 文件参数
     */
    let upload_upload_files=(param) =>{
        uploadFile(param.file, "upload_files");
    }
                                    /**
     * 上传上传音频
     * @param {Object} param 文件参数
     */
    let upload_upload_audio=(param) =>{
        uploadFile(param.file, "upload_audio");
    }
                                    /**
     * 上传上传视频
     * @param {Object} param 文件参数
     */
    let upload_upload_video=(param) =>{
        uploadFile(param.file, "upload_video");
    }
                                                    // 富文本编辑器更新
    let update_detailed_description = (obj) => {
        form.value.detailed_description = obj;
    };
    let blur_detailed_description = (obj) => {
        form.value.detailed_description = obj;
    };
                        /**
    * 上传封面图
    * @param {Object} file 文件对象
    * @param {key} 保存键名
    */
    const uploadFile = (file, key = "img") => {
        var formobj = new FormData(); // FormData 对象
        formobj.append("file", file); // 文件对象
              $upload(url_upload.value, formobj, function (json) {
          if (json.result) {
            form.value[key] = json.result.url;
          } else {
            ElMessage.error("上传失败！");
          }
        });
    };
    /**
     * 上传文件
     * @param {String} url 请求地址
     * @param {Object} body 请求参数
     * @param {Funciton} func 回调函数，可以为空，为空则采用await返回值
     * @return {Object} 返回请求结果
     */
    let $upload = async (url, body, func) => {
      url = url.replace("~/", $banseUrl);

      if (func) {
        // 如果回调函数存在, 则采用异步
              $post(url, body, {
          headers: {
            "x-auth-token": token,
            "Content-Type": "multipart/form-data",
          },
        })
            .then((res) => {
              func(res);
            })
            .catch((res) => {
              func(res);
            });
      } else {
        // 否则采用同步
        var res = await $post(url, body, {
          headers: {
            "x-auth-token": token,
            "Content-Type": "multipart/form-data",
          },
        });
        return res;
      }
    };
  //提交前验证事件
  let submit_check = () => {
                                                                                                  };
  // 点击取消
  let cancel = () => {
    router.go(-1);
  };
  // 点击提交
  let onSubmit = async () => {
    let valid = await ruleFormRef.value.validate();
    if (valid) {
      // 提交表单
      if (feedback_on_opinions_id) {
        // 编辑
        delete form.value.update_time;
              $post(url_set.value + "?feedback_on_opinions_id=" + feedback_on_opinions_id, form.value).then((res) => {
          if (res.result) {
          router.push("/home/feedback_on_opinions/table");
          ElMessage.success("提交成功！");
          } else if (res.error) {
            ElMessage.error(res.error.message);
          }
        });

      } else {
        // 新增
              $post(url_add.value, form.value).then((res) => {
          if (res.result) {
              router.push("/home/feedback_on_opinions/table");
              ElMessage.success("提交成功！");
          } else if (res.error) {
            ElMessage.error(res.error.message);
          }
        });

      }
    } else {
      ElMessage.error(msg);
    }
  };
  // 查询数组对象某个是否包含某个值,返回对应对象
  let getObj = (arr, val) => {
    let obj = arr.find((item) => item.user_id == val);
    let ret = "";
    if (obj) {
      if (obj.nickname) {
        ret = obj.nickname;
      } else {
        ret = obj.username;
      }
    }
    return ret;
  };
  //获取对象之前
  let get_obj_before = (param) => {
    var formArr = "";
                                  if(form.value && formArr){
      Object.keys(form.value).forEach(key => {
        Object.keys(formArr).forEach(dbKey => {
          if(key === dbKey){
            disabledObj.value[key+'_isDisabled'] = true;
          }
        })
      })
    }
                                                    localStorage.removeItem('form')
    return param;
  }
  // js判断字段是否是时间戳格式
  let isTimestamp = (value) => {
    return /^\d{10}$/.test(value) || /^\d{13}$/.test(value);
  }
  //获取对象之后
  let get_obj_after = (json, func) => {
                                                                                                                                                      if (form.value.refund_product){
                  refund_product_multiple_value = form.value.refund_product.split(",")
          }
                                                                                                                                                                                                                      }
  let is_view = () => {
    var bl = user_group == "管理员";
    if (!bl) {
      bl = $check_action('/feedback_on_opinions/table', 'add');
      console.log(bl ? "你有表格添加权限视作有添加权限" : "你没有表格添加权限");
    }
    if (!bl) {
      bl = $check_action('/feedback_on_opinions/table', 'set');
      console.log(bl ? "你有表格添加权限视作有修改权限" : "你没有表格修改权限");
    }
    if (!bl) {
      bl = $check_action('/feedback_on_opinions/view', 'add');
      console.log(bl ? "你有视图添加权限视作有添加权限" : "你没有视图添加权限");
    }
    if (!bl) {
      bl = $check_action('/feedback_on_opinions/view', 'set');
      console.log(bl ? "你有视图修改权限视作有修改权限" : "你没有视图修改权限");
    }
    if (!bl) {
      bl = $check_action('/feedback_on_opinions/view', 'get');
      console.log(bl ? "你有视图查询权限视作有查询权限" : "你没有视图查询权限");
    }
    console.log(bl ? "具有当前页面的查看权，请注意这不代表你有字段的查看权" : "无权查看当前页，请注意即便有字段查询权限没有页面查询权限也不行");
    return bl;
  }
  // 获取详情
  let get_feedback_on_opinions_obj = async () => {
    let list = await $get("/api/feedback_on_opinions/get_obj?feedback_on_opinions_id=" + feedback_on_opinions_id);
    form.value = list.result.obj;
    get_obj_after();
  };
  onMounted(() => {
          get_list_feedback_type();
            get_list_user_feedback_to_users();
          get_group_user_feedback_to_users();
                  get_list_refund_product();
                                    if (feedback_on_opinions_id) {
      get_feedback_on_opinions_obj();
    }else {
      get_obj_before();
      get_obj_after();
    }

  });
</script>

<style scoped lang="less">
  .diy_edit {
    width: 100%;

    .edit_feedback_on_opinions_form {
      max-width: 80%;
      margin: 90px auto;

      .fn {
        width: 100%;
      }
    }

    img {
      width: 100px;
      height: 100px;
    }

    .edit_list_feedback_on_opinions_sell {
      width: 80%;
      margin: 90px auto;
    }

    .footer {
      text-align: center;
    }
  }
</style>
  